function replaceUrl(url, param, value){
	
	if(value.indexOf('=') > 0){
		
		value = value.substring(value.indexOf('=')+1);
	}
	if(url.indexOf(param) >= 0){
		
		var temp = url.substring(url.indexOf(param));
		
		if(temp.substr(1).indexOf('&') > 0){
			
			temp = temp.substring(0, temp.substr(1).indexOf('&')+1);
		}
		if(value == ''){
			
			url = url.replace(temp, '');
		}else{
			
			url = url.replace(temp, param + value);
		}
	}else if(value != ''){
		
		url += param + value;
	}
	
	//delete page total
	if(url.indexOf('&TotalResult=') > 0){
		
		var totalstr = url.substring(url.indexOf('&TotalResult='));
		
		if(totalstr.substr(1).indexOf('&') > 0){
			
			totalstr = totalstr.substring(0, totalstr.substr(1).indexOf('&')+1);
		}
		url = url.replace(totalstr, '');
	}else if(value != '' && param == '&TotalResult='){
		url += param + value;
	}
	//delete page no
	if(url.indexOf('&PageNo=') > 0){
		
		var pageno = url.substring(url.indexOf('&PageNo='));
		
		if(pageno.substr(1).indexOf('&') > 0){
			
			pageno = pageno.substring(0, pageno.substr(1).indexOf('&')+1);
		}
		url = url.replace(pageno, '');
	}else if(value != '' && param == '&PageNo='){
		
		url += param + value;
	}
	
	return url;
}

//获取url中的参数
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
	var r = window.location.search.substr(1).match(reg);  //匹配目标参数
	if (r != null) return unescape(r[2]); return null; //返回参数值
}

function emailCheck(val)
{
	var reg = /^[a-zA-Z0-9\._-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
	var check = reg.test(val);
	return check;
}